import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

// 移动端适配 flexible.js
import "lib-flexible/flexible.js";
// 引入 样式重置  公共的css 和 处理1px边框的css
import "./assets/style/reset.css"; //样式重置
import "./assets/style/border.css"; //解决移动端1px边框问题
import "./assets/style/iconfont.css"; //字体图标
// 引入mock的数据
// npm i mockjs  --save-dev
require('./Mock.js')
router.beforeEach((to, from, next) => {
  if (to.name == "search" || to.name == "searchList" || to.name == "info") {
    store.commit("changeNavFlag", false)
  } else {
    store.commit("changeNavFlag", true)
  }
  next()
})

Vue.config.productionTip = false;
// vant 的使用
import {
  Tabbar,
  TabbarItem,
  Search,
  Swipe,
  SwipeItem,
  List,
  PullRefresh,
  Field,
  CellGroup,
  Button,
  Image as VanImage,
  GoodsAction,
  GoodsActionIcon,
  GoodsActionButton,
  Sidebar,
  SidebarItem,
  Icon,
  DropdownMenu,
  DropdownItem,
  Popup,
  Tag,
  SwipeCell,
  Checkbox,
  Stepper,
  NavBar,
  SubmitBar,
  Dialog,
  AddressList,
  AddressEdit,
  Sku,
  Toast,
  Cell,
  Radio,
  RadioGroup,
  Tab,
  Tabs,
  Card,
  CheckboxGroup
} from "vant";
Vue.prototype.$Dialog = Dialog;
Vue.prototype.$Toast = Toast;
Vue.use(Card);
Vue.use(CheckboxGroup);
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(Cell);
Vue.use(Sku);
Vue.use(AddressEdit);
Vue.use(AddressList);
Vue.use(SubmitBar);
Vue.use(NavBar);
Vue.use(Checkbox);
Vue.use(Stepper);
Vue.use(SwipeCell);
Vue.use(Tag);
Vue.use(Popup);
Vue.use(DropdownMenu);
Vue.use(DropdownItem);
Vue.use(Icon);
Vue.use(Sidebar);
Vue.use(SidebarItem);
Vue.use(GoodsAction);
Vue.use(GoodsActionIcon);
Vue.use(GoodsActionButton);
Vue.use(VanImage);
Vue.use(Button);
Vue.use(CellGroup);
Vue.use(Field);
Vue.use(Tabbar);
Vue.use(TabbarItem);
Vue.use(Search);
Vue.use(Swipe);
Vue.use(SwipeItem);
Vue.use(List);
Vue.use(PullRefresh);

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
